// 蜂窝蜜造平台生成代码，如手工更改，请添加到 .beeignore 忽略生成
package com.fowo.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.common.model.IdListPo;
import com.fowo.api.common.model.ImportRow;
import com.fowo.api.common.model.OptionItem;
import com.fowo.api.common.model.R;
import com.fowo.api.common.util.ResponseUtils;
import com.fowo.api.entity.Product;
import com.fowo.api.model.product.*;
import com.fowo.api.model.product.spu.ProductSpuItemVo;
import com.fowo.api.model.product.spu.ProductSpuSearchParamPo;
import com.fowo.api.service.ProductService;
import com.fowo.api.service.impl.ProductServiceImpl;
import com.fowo.api.sys.entity.SysFile;
import com.fowo.api.user.model.JwtUserInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.core.io.ClassPathResource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.StreamUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

@Tag(name = "产品")
@RequestMapping("/api/product")
@RestController
public class ProductCustomController {


  @Resource
  private ProductServiceImpl service;
  @Operation(summary = "根据sku获取详情")
  @GetMapping("/sku")
  public R<Product> getProductBySku(String sku){
    return R.data(() -> service.getProductBySku(sku));
  }
}
